{%extends file="wap_common/page/layout.tpl"%}


{%block name="head-static"%}
    {%require name="wap_main:static/gift/gift.less"%}
    {%require name="wap_main:static/gift/gift.js"%}
{%/block%}

{%block name="layout-body"%}
    <div class="wap-main-gift">
        <div class="gift-content">
            <ul class="type-tab">
                <li class="active red" data-type='red'>红包</li>
                <li class="voucher" data-type='voucher'>优惠券</li>
                <div class="clear"></div>
            </ul>
            <div class="explain">
                <a  style="color:#ff9614" href="/share/asset?sequence_id={%$data.user.sequence_id%}">晒收益，抢红包</a>
                <span class="text">查看使用说明>></span>
                <div class="clear"></div>
            </div>
            <ul class="gift-list red-gift">
                {%foreach $data.lottery as $item%}
                    <li {%if $item.status==0%}class="active"{%/if%}>
                        {%if $item.time>=$data.today%}<i class="new"></i>{%/if%}
                        <div class="gift-item">
                            <div class="left">
                                <span>￥</span>
                                <span class="number">{%$item.amount%}</span>
                            </div>
                            <div class="right">
                                <div class='status'>
                                    {%if $item.status==0%}
                                    未使用
                                    {%elseif $item.status==1%}
                                    已使用
                                    {%elseif $item.status==1%}
                                    已过期
                                    {%/if%}
                                </div>
                                <div class="time">有效期：{%$item.expire_time|date_format:"%Y-%m-%d" %}</div>
                                <div class="rule">
                                    <span>使用规则：</span>
                                    {%if $item.type==2%}
                                    仅限使用于定期红包
                                    {%elseif $item.type==102%}
                                    可增加活期收益一天
                                    {%elseif $item.type==103%}
                                    可增加活期可购份额
                                    {%/if%}
                                </div>
                            </div>
                        </div>
                    </li>
                {%/foreach%}
            </ul>

            <ul class="gift-list voucher-gift">
                {%foreach $data.coupon as $item%}
                <li {%if $item.status==0%}class="active"{%/if%}>
                    {%if $item.time>=$data.today%}<i class="new"></i>{%/if%}
                    <div class="gift-item">
                        <div class="left">
                            {%if $item.type==102%}
                                <span class="number">{%$item.amount%}</span>
                            {%else%}
                                <span>￥</span>
                                <span class="number">{%$item.amount%}</span>
                            {%/if%}
                        </div>
                        <div class="right">
                            <div class='status'>
                                {%if $item.status==0%}
                                未使用
                                {%elseif $item.status==1%}
                                已使用
                                {%elseif $item.status==1%}
                                已过期
                                {%/if%}
                            </div>
                            <div class="time">有效期：{%$item.expire_time|date_format:"%Y-%m-%d" %}</div>
                            <div class="rule">
                                <span>使用规则：</span>
                                {%if $item.type==2%}
                                仅限使用于定期红包
                                {%elseif $item.type==102%}
                                可增加活期收益一天
                                {%elseif $item.type==103%}
                                可增加活期可购份额
                                {%/if%}
                            </div>
                        </div>
                    </div>
                </li>
                {%/foreach%}
            </ul>
        </div>
    </div>
{%/block%}